package com.guojunyu.exp3.demo.controller;

import com.guojunyu.exp3.demo.entity.Epidemic;
import com.guojunyu.exp3.demo.service.EpidemicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class EpidemicController {

    @Autowired
    EpidemicService epidemicService;

    @GetMapping("/")
    public List<Epidemic> getEpidemicList(@RequestParam(required = false) String country, @RequestParam(required = false) String province) {
        return epidemicService.getEpidemicList(country, province);
    }
}
